import { View, Text, Image } from '@tarojs/components'
import './index.scss'

function App(props) {

    const {
        item,
        size,
        index,
        src,
        handleDownload,
        onClick
    } = props

    return (
        <View key={item.attachmentId} className='file_item' onClick={(e) => { typeof onClick === 'function' && onClick(e) }}>
            <View
                className="docItem"
            >
                <View className="docIcon">
                    <Image className="docImg" src={src} />
                </View>
                <View className="docInfo">
                    <View className="docName oneline">{decodeURIComponent(item.name||item.fileName)}</View>
                    <View className="docSize">{size}</View>
                </View>
                <View
                    className="downLoadIcon_content"
                    onClick={(e) => { typeof handleDownload === 'function' && handleDownload(item, index, e) }}
                >
                </View>
            </View>
        </View>
    )
}
export default App